﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.YG
{
    /// <summary>
    /// 阳光人寿阳光人生终身寿险（分红型）
    /// </summary>
    class Class12
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {
                if (ppa.Age < 1)
                    da.Value = ppa.Amount * 0.25;
                else if (ppa.Age >= 1 && ppa.Age < 2)
                    da.Value = ppa.Amount * 0.5;
                else if (ppa.Age >= 2 && ppa.Age < 3)
                    da.Value = ppa.Amount * 0.75;
                else
                    da.Value = ppa.Amount;

                ppa.IsCurrentFinish = true;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period==ppa.PolicyActing.PeriodActings.Count()-1)
            {
                IPolicyPeriodActing ppa2 = ppa.SchemePeriodActing.GetPolicyPeriodActiing("阳光_真心120提前给付重大疾病保险_附");

                double epTotalFee = ppa2 == null ? 0 : ppa2.TotalFee;

                da.Value = (ppa.TotalFee + epTotalFee) * 1.2;

            }
        }
    }
}
